package com.kenliang.algorithm.sort;

/**
 * @author KenLiang
 * @description:
 * @date Created in 11:04 AM 2021/1/14.
 */
public interface ISort {
    int[] sort(int[] in);

    default void swap(int[] in, int a, int b) {

        int temp = in[b];
        in[b] = in[a];
        in[a] = temp;
        //a和b内存地址一样，出来的结果就变成0了
//        in[b] = in[a] ^ in[b];
//        in[a] = in[a] ^ in[b];
//        in[b] = in[a] ^ in[b];
    }

    default void soutArray(int[] in){
        for(int i=0;i<in.length;i++){
            System.out.print(in[i]);
            System.out.print(",");
        }
        System.out.println("");
    }
}
